<template>
	<view class="">
		<image class="BGImage1" src="/static/share/bg.png" mode=""></image>

		<view @click="leftClick()" class="leftButton fixed-top " >
				<u-icon name="arrow-left" color="white" size="26"></u-icon>
		</view>
			<view class="fixed-bottom flex-column-center">
				<view class="bottom flex-column-flex-start1">
					<image class="gzImage" src="/static/share/gz.png" mode=""></image>
					<view class="nodes">
							<u-parse :content="nodes"></u-parse>
					</view>
				</view>
				<view class="bottom1 flex-column-center">
					<view class="code">
						<image :src="user.intive_code" mode=""></image>
						
					</view>
					<view @click="copyText()" class="button flex-row-center">
						立即邀请
					</view>
				</view>
			</view>

		
	</view>
</template>

<script>
	
	export default {
		data(){
			return {
				user:'',
				nodes:''
			}
		},
		onLoad() {
			this.user=uni.getStorageSync('user')
			this.init()
			this.text()
		},
		methods:{
			init() {
				// 获取个人信息
				this.$http.post('api/user/detail').then(res => {
					uni.setStorageSync('user', res)
					this.user=uni.getStorageSync('user')
				});

			
			},
			leftClick(){
			uni.navigateBack()	
			},
			copyText() {
				uni.setClipboardData({
					data: this.user.invite_url,
					success: function() {
						uni.showToast({
							title: '链接已复制',
							duration: 2000,
						});
					}
				})
			},
			text(){
				this.$http.post('api/sys/article',{
					id: 10
				}).then(res =>{
					this.nodes = res.content;
					console.log(res);
				})
			}
			
			
		}
	}
	
	
</script>

<style scoped lang="less">
	.BGImage1{
		position: fixed;
		width: 100%;
		height: 100%;
		bottom: 0;
		top: 0;
		left: 0;
		z-index: 2;
	}
	.bottom1{
		margin-bottom: 89rpx;
		width: 696rpx;
		height: 392rpx;
		background: #FCEEBD;
		border-radius: 10rpx;
	}
	.code{
		width: 207rpx;
		height: 207rpx;
		// background: #FF540E;
		border-radius: 12rpx;
		border: 10rpx solid #FF540E;
		image{
			width: 100%;
			height: 100%;
		}
	}
	.button{
		margin-top: 33rpx;
		width: 441rpx;
		height: 70rpx;
		background: linear-gradient(0deg, #FEA20F, #FE530E);
		border-radius: 35rpx;
		font-size: 42rpx;
		font-family: SourceHanSansCN;
		font-weight: 500;
		color: #FFFFFF;
	}
	.bottom{
		margin-bottom: 21rpx;
		width: 696rpx;
		background: #FCEEBD;
		border-radius: 10rpx;
	}
	.gzImage{
		// margin-top: -12rpx;
		width: 477rpx;
		height: 66rpx;
	}
	.nodes{
		margin: 0 28rpx;
	}
</style>
